Skip to content

fix: SONA zero-vector bug, RVF wasm persistence, metadata safety (#704, #705, #706, #707) - #708

Merged
ruvnet merged 1 commit into
mainfrom
fix/sona-rvf-issues-704-705-706-707
Jul 17, 2026
Merged

ruvnet merged 1 commit into
mainfrom
fix/sona-rvf-issues-704-705-706-707

Conversation

@ruvnet

@ruvnet ruvnet commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • SONA N-API applyMicroLora returns zero/delta instead of identity plus delta #706 — apply_micro_lora/apply_base_lora seeded their output buffer with zeros in napi.rs, napi_simple.rs, and wasm.rs, but the Rust LoRA forward pass has residual semantics (adds the delta into the buffer). Cold queries returned the zero vector; post-feedback queries returned only the delta instead of input+delta. Fixed by seeding the output buffer with a clone of the input in all three binding layers. Added 3 regression tests to npm/packages/sona/test/basic.test.js (verified they fail on the old code, pass on the fix, via a real build of the native addon).
  • Browser docs advertise unshipped RVF APIs; WasmBackend has no persistence export/import #705 — WasmBackend had no byte-level persistence. The underlying rvf_store_export/rvf_store_open C-ABI functions already existed in crates/rvf/rvf-wasm — wired them into WasmBackend.exportBytes()/openBytes() and RvfDatabase.exportBytes()/openBytes(). Verified end-to-end against the real compiled .wasm binary (round-trips vectors through export → reopen).
  • RVF SDK silently drops metadata; native metadata is not durable or returned #704 — NodeBackend.ingestBatch() silently dropped RvfIngestEntry.metadata instead of forwarding it to native, and query() filter serialization omitted the native parser's required valueType. A full field-name↔fieldId design for durable metadata is a larger follow-up (native metadata also doesn't survive close/reopen at the Rust level — separate issue), so this PR applies the issue's own suggested interim fix: ingest now throws MetadataNotSupported instead of silently losing data. Filter serialization now infers and includes valueType. 8 new tests.
  • Node documentation advertises HybridSearch absent from ruvector@0.2.34 #707 — docs/api/NODEJS_API.md and docs/guides/ADVANCED_FEATURES.md advertised HybridSearch/FilteredSearch/MMRSearch/ConformalPredictor as Node exports; none are bound by crates/ruvector-node. Corrected with explicit "not yet shipped" notes.

Not included in this PR: README corrections for crates/rvf/README.md and npm/packages/rvf-wasm/README.md (both also describe the unshipped WasmRvfStore class). A local repo hook requires a screenshot-based visual design-grade for any README change that I can't complete in this environment (no browser/screenshot access) — will follow in a separate PR once that's sorted out, or feel free to fold the diff in yourself; it's a pure doc correction with no code risk.

Test plan

  • cargo build -p ruvector-sona --features napi — compiles clean
  • Built the real napi_simple addon (npm run build:debug in npm/packages/sona) and ran npm test — 14/14 pass including 3 new SONA N-API applyMicroLora returns zero/delta instead of identity plus delta #706 tests
  • npx tsc --noEmit in npm/packages/rvf — clean
  • Built the real rvf-wasm module path and ran new test-wasm-persistence.js against the actual shipped .wasm binary — 3/3 pass
  • node tests/test-metadata-and-filters.js — 8/8 pass
  • Full existing npm/packages/rvf/tests/* and npm/packages/sona/test/* suites — no regressions

Co-Authored-By: claude-flow ruv@ruv.net

… gaps

- #706: apply_micro_lora/apply_base_lora seeded their output buffer with
  zeros in napi.rs, napi_simple.rs, and wasm.rs, but the Rust LoRA forward
  pass has residual semantics (adds delta into the buffer). Cold queries
  collapsed to the zero vector, and post-feedback queries returned only
  the delta instead of input+delta. Fixed by seeding with a clone of the
  input in all three binding layers. Added regression tests.

- #705: WasmBackend had no byte-level persistence. The underlying
  rvf_store_export/rvf_store_open C-ABI functions already existed —
  wired them into WasmBackend.exportBytes()/openBytes() and
  RvfDatabase.exportBytes()/openBytes(), verified against the real
  compiled .wasm binary.

- #704: NodeBackend.ingestBatch() silently dropped RvfIngestEntry.metadata
  instead of forwarding it, and query() filter serialization omitted the
  native parser's required valueType. Since a full field-name-to-id
  design for metadata durability is a larger follow-up, applied the
  issue's own suggested interim fix: ingest now throws
  MetadataNotSupported instead of silently losing data. Filter
  serialization now infers and includes valueType.

- #707: docs/api/NODEJS_API.md and docs/guides/ADVANCED_FEATURES.md
  advertised HybridSearch/FilteredSearch/MMRSearch/ConformalPredictor as
  Node exports; none are bound by crates/ruvector-node. Corrected with
  explicit "not yet shipped" notes pointing at the tracking issue.

README corrections for #705/#707 (WasmRvfStore, HybridSearch docs) are
staged separately — a repo hook requires a visual design-grade ritual for
any README change that this session cannot complete (no browser/screenshot
access), so they'll follow once that's resolved.

Co-Authored-By: claude-flow <ruv@ruv.net>
@ruvnet
ruvnet merged commit fe11269 into main Jul 17, 2026
53 of 56 checks passed
@ruvnet
ruvnet deleted the fix/sona-rvf-issues-704-705-706-707 branch July 17, 2026 17:34
ruvnet added a commit that referenced this pull request Jul 17, 2026
Publishes the #706 zero-vector fix (residual LoRA seeding) merged in #708.

Co-Authored-By: claude-flow <ruv@ruv.net>
ruvnet added a commit that referenced this pull request Jul 17, 2026
Publishes the #705 WASM persistence (exportBytes/openBytes) and #704
metadata-safety (MetadataNotSupported, filter valueType inference) fixes
merged in #708. Minor bump: additive, non-breaking public API surface.

Co-Authored-By: claude-flow <ruv@ruv.net>
ruvnet added a commit that referenced this pull request Jul 17, 2026
crates/rvf/README.md and npm/packages/rvf-wasm/README.md described an
unshipped WasmRvfStore class. Corrected both to show the actual
@ruvector/rvf WasmBackend usage, including the new exportBytes()/
openBytes() persistence API from #708.

Co-Authored-By: claude-flow <ruv@ruv.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant